extends Node

var fsm:StateMachine

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	print('XXXX 状态1 初始化')


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	pass

func enter():
	print("Hello from State 1!")
	# Exit 2 seconds later
	await get_tree().create_timer(2.0).timeout
	self._exit("State2")
	

func _exit(next_state):
	fsm.change_to(next_state)


func _unhandled_key_input(event):
	if event.pressed:
		print("From State1")
